package com.jia.videos.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jia.videos.entity.VideoDetail;
import com.jia.videos.mapper.VideoDetailMapper;
import com.jia.videos.service.VideoDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dujiajia
 * @since 2020-12-21
 */
@Service
public class VideoDetailServiceImpl extends ServiceImpl<VideoDetailMapper, VideoDetail> implements VideoDetailService {

    @Override
    public List<VideoDetail> getListByTypeId(Long typeId) {

        QueryWrapper<VideoDetail> wrapper = new QueryWrapper<>();
        wrapper.eq("type_id",typeId);
        wrapper.orderByAsc("sort");
        List<VideoDetail> videoDetails = baseMapper.selectList(wrapper);
        return videoDetails;
    }
}
